<?php	
	global $current_user;
	$current_user = wp_get_current_user();
	function wp_get_user_roles_by_user_id( $user_id ) {
	    $user = get_userdata( $user_id );
	    return empty( $user ) ? array() : $user->roles;
	}
	$myrole = wp_get_user_roles_by_user_id( $current_user->ID );
	$usermeta = get_the_author_meta( 'add_user_role', $current_user->ID );
	//print_r($current_user);
	//print_r($myrole);
	include TEMPLATEPATH.'/orders/order-install-database.php'; 
	include TEMPLATEPATH.'/orders/process.php';
	
	if($myrole[0]=="administrator" && ($current_user->user_login=="admin" || $current_user->user_login=="dbthanhbinh"))
	{		
			include TEMPLATEPATH.'/admins/index.php';			
			require_once TEMPLATEPATH .'/incs/payments/paypal/payments.php';			
			include TEMPLATEPATH.'/orders/tour/tour-setting.php';		
			include TEMPLATEPATH.'/orders/hotel/hotel-setting.php';		
			include TEMPLATEPATH.'/orders/agents/travel-agent-setting.php';		
			include TEMPLATEPATH.'/orders/ticket/ticket-setting.php';		
			include TEMPLATEPATH.'/orders/visas/visa-setting.php';
	}
	else
	{
		//My remove
		global $list_admin_role,$option_roles;
		
		$list_admin_role = db_list_link_admin();
		$option_role = get_option("mysetting_user_role".$current_user->ID);
		if($option_role)
		$option_roles = explode(",", $option_role);
		 
		add_action('admin_menu', 'remove_menus2', 102);
		function remove_menus2($current_user)
		{
			global $submenu,$current_user,$list_admin_role,$option_roles;		
						
			foreach ($list_admin_role as $key=>$value) 
			{				
				if(!db_check_exists_value_in_array($option_roles, $key) && strstr($key, "Editor"))
				{
					remove_menu_page( $value );
				}
			}			              
		} 
		
		## xet phan admin include booked
			foreach ($list_admin_role as $key=>$value) 
			{				
				if(db_check_exists_value_in_array($option_roles, $key) && strstr($key, "Admin"))
				{
					include $value;
				}
			}
	}